:root {
  --side-bar-bg-color: #fafafa;
  --control-text-color: #777;
}

/* 让链接在 hover 状态下显示下划线 */
.typo a, .typo-a {
  color: #1abc9c;
}

.typo a:hover {
  text-decoration: underline;
}

//.typo a:hover {
//    border-bottom-color: #555;
//    color: #555;
//    //text-decoration: none;
//}

/* 默认不显示下划线，保持页面简洁 */
ins, a {
  text-decoration: none;
}

/* 保证块/段落之间的空白隔行 */
.typo p, .typo pre, .typo ul, .typo ol, .typo dl, .typo form, .typo hr, .typo table,
.typo-p, .typo-pre, .typo-ul, .typo-ol, .typo-dl, .typo-form, .typo-hr, .typo-table, blockquote {
  margin-bottom: 1.2em;
}

/* 在文章中，应该还原 ul 和 ol 的样式 */
.typo ul, .typo-ul {
  //margin-left: 1.3em;
  margin-left: 15px;
  list-style: disc;
}

.typo ol, .typo-ol {
  list-style: decimal;
  margin-left: 1.9em;
}

.typo li ul, .typo li ol, .typo-ul ul, .typo-ul ol, .typo-ol ul, .typo-ol ol {
  margin-bottom: 0.8em;
  margin-left: 2em;
}

.typo li ul, .typo-ul ul, .typo-ol ul {
  list-style: circle;
}

/* 同 ul/ol，在文章中应用 table 基本格式 */
.typo table th, .typo table td, .typo-table th, .typo-table td, .typo table caption {
  border: 1px solid #ddd;
  padding: 0.5em 1em;
  color: #666;
}

.typo table th, .typo-table th {
  background: #fbfbfb;
}

.typo table thead th, .typo-table thead th {
  background: #f1f1f1;
}

.typo table caption {
  border-bottom: none;
}

/* 去除 webkit 中 input 和 textarea 的默认样式  */
.typo-input, .typo-textarea {
  -webkit-appearance: none;
  border-radius: 0;
}

.typo-em, .typo em, legend, caption {
  color: #000;
  font-weight: inherit;
}

/* 着重号，只能在少量（少于100个字符）且全是全角字符的情况下使用 */
.typo-em {
  position: relative;
}

.typo-em:after {
  position: absolute;
  top: 0.65em;
  left: 0;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  content: "・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・";
}

/* Responsive images */
.typo img {
  max-width: 100%;
}

/* 底部印刷体、版本等标记 */
small, .typo-small, /* 图片说明 */
figcaption {
  font-size: 0.9em;
  color: #888;
}

.typo {
  font-family: 'SF mono', '等线', sans-serif;
  margin: 0 auto;
  //padding: 0 40px;
  color: #333;

  button::-moz-focus-inner,
  input::-moz-focus-inner {
    padding: 0;
    border: 0;
  }

  mark {
    //background: #fffdd1;
    //border-bottom: 1px solid #ffedce;
    //padding: 2px;
    //margin: 0 5px;
    color: #c7254e;
    background-color: #f9f2f4;
    border-radius: 2px;
  }

  abbr {
    cursor: help;
  }

  acronym, abbr {
    border-bottom: 1px dotted;
    font-variant: normal;
    text-decoration: none;
  }

  address, caption, cite, code, dfn, em, th, var {
    font-style: normal;
    font-weight: 400;
  }

  /* 对齐是排版最重要的因素, 别让什么都居中 */

  caption, th {
    text-align: left;
  }

  q:before, q:after {
    content: '';
  }

  /* 统一上标和下标 */

  sub, sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
  }

  :root sub, :root sup {
    vertical-align: baseline; /* for ie9 and other modern browsers */
  }

  sup {
    top: -0.5em;
  }

  sub {
    bottom: -0.25em;
  }

  @font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: normal;
    src: local('Open Sans Regular'), url('./typo/400.woff') format('woff');
  }

  @font-face {
    font-family: 'Open Sans';
    font-style: italic;
    font-weight: normal;
    src: local('Open Sans Italic'), url('./typo/400i.woff') format('woff');
  }

  @font-face {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: bold;
    src: local('Open Sans Bold'), url('./typo/700.woff') format('woff');
  }

  @font-face {
    font-family: 'Open Sans';
    font-style: italic;
    font-weight: bold;
    src: local('Open Sans Bold Italic'), url('./typo/700i.woff') format('woff');
  }

  h1, h2, h3, h4, h5, h6 {
    outline: none;
    position: relative;
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-weight: bold;
    line-height: 1.4;
    //cursor: text;
  }

  h1:hover a.anchor,
  h2:hover a.anchor,
  h3:hover a.anchor,
  h4:hover a.anchor,
  h5:hover a.anchor,
  h6:hover a.anchor {
    text-decoration: none;
  }

  h1 tt,
  h1 code {
    font-size: inherit;
  }

  h2 tt,
  h2 code {
    font-size: inherit;
  }

  h3 tt,
  h3 code {
    font-size: inherit;
  }

  h4 tt,
  h4 code {
    font-size: inherit;
  }

  h5 tt,
  h5 code {
    font-size: inherit;
  }

  h6 tt,
  h6 code {
    font-size: inherit;
  }

  h1 {
    padding-bottom: .3em;
    font-size: 2.25em;
    line-height: 1.2;
    border-bottom: 1px solid #eee;
  }

  h2 {
    padding-bottom: .3em;
    font-size: 1.75em;
    line-height: 1.225;
    border-bottom: 1px solid #eee;
  }

  h3 {
    font-size: 1.5em;
    line-height: 1.43;
  }

  h4 {
    font-size: 1.25em;
  }

  h5 {
    font-size: 1em;
  }

  h6 {
    font-size: 1em;
    color: #777;
  }

  p,
  blockquote,
    //ul,
    //ol,
  dl,
  table {
    margin: 0.8em 0;
  }

  li > ol,
  li > ul {
    margin: 0;
  }

  hr {
    height: 2px;
    padding: 0;
    margin: 16px 0;
    background-color: #e7e7e7;
    border: 0 none;
    overflow: hidden;
    box-sizing: content-box;
  }

  [draggable] {
    cursor: move;
  }

  /* 强制文本换行 */

  .textwrap, .textwrap td, .textwrap th {
    word-wrap: break-word;
    word-break: break-all;
  }

  .textwrap-table {
    table-layout: fixed;
  }

  /* 提供 serif 版本的字体设置: iOS 下中文自动 fallback 到 sans-serif */

  .serif {
    font-family: Palatino, Optima, Georgia, serif;
  }

  li p.first {
    display: inline-block;
  }

  ul,
  ol {
    padding-left: 30px;
  }

  ul:first-child,
  ol:first-child {
    margin-top: 0;
  }

  ul:last-child,
  ol:last-child {
    margin-bottom: 0;
  }

  /* > 引用 */

  blockquote {
    //border-left: 4px solid #dfe2e5;
    border-left: 4px solid #1abc9c;
    padding: 0 15px;
    color: #777777;
  }

  @media only screen and ( max-width: 640px ) {
    blockquote {
      margin: 1em 0;
    }
  }

  blockquote blockquote {
    padding-right: 0;
  }

  /* 去除默认边框 */

  fieldset, img {
    border: 0;
  }

  table {
    padding: 0;
    word-break: initial;
    /* 去掉各Table cell 的边距并让其边重合 */
    border-collapse: collapse;
    border-spacing: 0;
  }

  table tr {
    border-top: 1px solid #dfe2e5;
    margin: 0;
    padding: 0;
  }

  table tr:nth-child(2n),
  thead {
    background-color: #f8f8f8;
  }

  table tr th {
    font-weight: bold;
    border: 1px solid #dfe2e5;
    //border-bottom: 0;
    margin: 0;
    padding: 6px 13px;
  }

  table tr td {
    border: 1px solid #dfe2e5;
    margin: 0;
    padding: 6px 13px;
  }

  table tr th:first-child,
  table tr td:first-child {
    margin-top: 0;
  }

  table tr th:last-child,
  table tr td:last-child {
    margin-bottom: 0;
  }

  .CodeMirror-lines {
    font-family: 'SF mono', sans-serif;
    padding-left: 4px;
  }

  .CodeMirror {
    font-family: 'SF mono', sans-serif;
  }

  .code-tooltip {
    font-family: 'SF mono', sans-serif;
    box-shadow: 0 1px 1px 0 rgba(0, 28, 36, .3);
    border-top: 1px solid #eef2f2;
  }

  p code,
  tt {
    color: #c7254e;
    background-color: #f9f2f4;
    border: 1px solid #e7eaed;
    //background-color: #f8f8f8;
    border-radius: 3px;
    padding: 2px 4px 0 4px;
    font-size: 0.9em;
  }

  code {
    color: #c7254e;
    background-color: #f9f2f4;
    font-family: 'SF mono', sans-serif;
    //background-color: #f3f4f4;
    padding: 0 2px 0 2px;
  }

  pre code {
    padding: 0;
  }

  .md-fences {
    margin-bottom: 15px;
    margin-top: 15px;
    padding-top: 8px;
    padding-bottom: 6px;
  }


  .md-task-list-item > input {
    margin-left: -1.3em;
  }

  @media print {
    html {
      font-size: 13px;
    }

    table, pre {
      page-break-inside: avoid;
    }

    pre {
      word-wrap: break-word;
    }
  }

  .md-fences {
    background-color: #f8f8f8;
  }

  pre {
    display: block;
    padding: 1rem 1.5em;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #777777;
    -webkit-overflow-scrolling: touch;
  }

  .mathjax-block > .code-tooltip {
    bottom: .375rem;
  }

  .md-mathjax-midline {
    background: #fafafa;
  }

  > h3.md-focus:before {
    left: -1.5625rem;
    top: .375rem;
  }

  > h4.md-focus:before {
    left: -1.5625rem;
    top: .285714286rem;
  }

  > h5.md-focus:before {
    left: -1.5625rem;
    top: .285714286rem;
  }

  > h6.md-focus:before {
    left: -1.5625rem;
    top: .285714286rem;
  }

  .md-image > .md-meta {
    /*border: 1px solid #ddd;*/
    border-radius: 3px;
    padding: 2px 0 0 4px;
    font-size: 0.9em;
    color: inherit;
  }

  .md-tag {
    color: #a7a7a7;
    opacity: 1;
  }

  .md-toc {
    margin-top: 20px;
    padding-bottom: 20px;
  }

  h1, h2, h3, h4, h5, h6 {
    pointer-events: none;

    &::before {
      content: '';
      //width: 10px;
      //position: relative;
      padding-top: 75px;
      margin-top: -75px;
      display: block;
      visibility: hidden;
    }
  }
}
